3D Graphics Programming with QuickDraw 3D 1.5.4
Previous | QD3D Book | Overview | Chapter Contents | Next |
As mentioned earlier, the data associated with a file object must conform to the QuickDraw 3D Object Metafile standard. That standard defines two general forms for the 3D data: text form and binary form. A text file is a stream of ASCII characters with meaningful labels for each type of object contained in the file (for example, NURBCurve for a NURB curve). A binary file is a stream of raw binary data, the type of which is indicated by more cryptic object type codes (for example, nrbc for a NURB curve). The text form is most useful when you're writing and debugging your application, but the binary form is usually smaller (requiring less storage space on disk or in memory) and can be read and written much faster.
Disk-based metafile data, whether a text file or a binary file, should be contained in a file of type ' 3DMF '.
In addition, there are three ways to organize the data in a text or binary file object. A file object can be organized in normal mode, stream mode, or database mode.
In normal mode, a file object contains a table of contents that lists all multiply-referenced objects in the file. This is usually the most compact file object organization, but it requires random access to the file object data in order to resolve references. (It might not, therefore, be the best mode to use when transferring 3D data to a remote machine on a network.)
In stream mode, a file object does not contain a table of contents and any references to objects are simply copies of the objects themselves. This may result in a larger file than normal mode, but it allows the file object to be processed sequentially, without random access.
In database mode, a file object contains a table of contents that lists every object in the file, whether or not it is referenced within the file. This organization is useful if you want to determine what information a file object contains without having to read and process the entire file. This would be useful, for example, for creating a catalog of textures.
Figure 1 shows a sample text file object organized in each of these three ways. Once again, for complete information about the types of file objects and the ways of organizing them, see the 3D Metafile Reference .
Previous | QD3D Book | Overview | Chapter Contents | Next |